#!/bin/sh
#ex: ./update-conf.sh hieulq 4 512: edit config file and copy to Nimbus Client
# @command: ./update-conf.sh hieulq 4 512
# @output:
# none

USER=$1
CORE=$2
RAM=$3
TEMPFILE1=./cloud.tmp.~
TEMPFILE2=./cloud.tmp2.~

#### Set common environment variables
. ${0%/*}/options.list
####

sed "s/vws.memory.request=.*/vws.memory.request=${RAM}/g" ${UserDir}/${USER}/cloud.properties > $TEMPFILE1
sed "s/vws.cores.request=.*/vws.cores.request=${CORE}/g" $TEMPFILE1 > $TEMPFILE2

mv $TEMPFILE2 ${UserDir}/${USER}/cloud.properties
rm -rf $TEMPFILE1
